package com.fira.edu.service.impl;

import java.util.List;
import com.fira.common.utils.DateUtils;
import com.fira.common.utils.uuid.IdUtils;
import com.fira.edu.domain.vo.StudentOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fira.edu.mapper.EduStudentSettleMapper;
import com.fira.edu.domain.EduStudentSettle;
import com.fira.edu.service.IEduStudentSettleService;
import com.fira.common.core.text.Convert;

/**
 * 学员课程交费结算Service业务层处理
 * 
 * @author wuzhenggui
 * @date 2021-10-11
 */
@Service
public class EduStudentSettleServiceImpl implements IEduStudentSettleService 
{
    @Autowired
    private EduStudentSettleMapper eduStudentSettleMapper;

    /**
     * 查询学员课程交费结算
     * 
     * @param id 学员课程交费结算ID
     * @return 学员课程交费结算
     */
    @Override
    public EduStudentSettle selectEduStudentSettleById(String id)
    {
        return eduStudentSettleMapper.selectEduStudentSettleById(id);
    }

    /**
     * 查询学员课程交费结算列表
     * 
     * @param eduStudentSettle 学员课程交费结算
     * @return 学员课程交费结算
     */
    @Override
    public List<EduStudentSettle> selectEduStudentSettleList(EduStudentSettle eduStudentSettle)
    {
        return eduStudentSettleMapper.selectEduStudentSettleList(eduStudentSettle);
    }

    /**
     * 新增学员课程交费结算
     * 
     * @param eduStudentSettle 学员课程交费结算
     * @return 结果
     */
    @Override
    public int insertEduStudentSettle(EduStudentSettle eduStudentSettle)
    {
        eduStudentSettle.setId(IdUtils.fastSimpleUUID());
        eduStudentSettle.setCreateTime(DateUtils.getNowDate());
        return eduStudentSettleMapper.insertEduStudentSettle(eduStudentSettle);
    }

    /**
     * 修改学员课程交费结算
     * 
     * @param eduStudentSettle 学员课程交费结算
     * @return 结果
     */
    @Override
    public int updateEduStudentSettle(EduStudentSettle eduStudentSettle)
    {
        eduStudentSettle.setUpdateTime(DateUtils.getNowDate());
        return eduStudentSettleMapper.updateEduStudentSettle(eduStudentSettle);
    }

    /**
     * 删除学员课程交费结算对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEduStudentSettleByIds(String ids)
    {
        return eduStudentSettleMapper.deleteEduStudentSettleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学员课程交费结算信息
     * 
     * @param id 学员课程交费结算ID
     * @return 结果
     */
    @Override
    public int deleteEduStudentSettleById(String id)
    {
        return eduStudentSettleMapper.deleteEduStudentSettleById(id);
    }

    /**
     * 查询学生订单列表信息
     *
     * @param studentId
     * @return
     */
    @Override
    public List<StudentOrderVO> selectStudentOrders(String studentId) {
        return eduStudentSettleMapper.selectStudentOrders(studentId);
    }
}
